package com.xqboss.web.controller.user;

import com.xqboss.apps.domain.user.UserAssetWrenchReceive;
import com.xqboss.apps.dto.user.WrenchReferrerRecordQueryDto;
import com.xqboss.apps.service.user.UserAssetWrenchReceiveService;
import com.xqboss.apps.vo.user.WrenchReferrerRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
import com.xqboss.common.core.controller.BaseController;
import com.xqboss.common.core.domain.R;
import org.springframework.web.bind.annotation.RequestBody;
import io.swagger.annotations.Api;
import com.xqboss.chain.domain.chain.dto.BaseRequest;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.validation.annotation.Validated;

/**
 * <p>
 * 用户资产-扳手
 * </p>
 *
 * @author 木鱼
 * @since 2023-12-07
 */
@Slf4j
@Api(tags = "用户资产-扳手")
@RestController("WebUserAssetWrenchController")
@RequestMapping("/web/user/asset/wrench")
public class UserAssetWrenchController extends BaseController {


    @Autowired
    private UserAssetWrenchReceiveService userAssetWrenchReceiveService;

    @ApiOperation("邀请奖励分页列表")
    @GetMapping("/reward/page/list")
    public R<List<WrenchReferrerRecordVo>> rewardPageList(@Validated WrenchReferrerRecordQueryDto param) {
        if (param.getUserId() == null) {
            return R.fail("用户id不能为空");
        }
        param.startPage();
        return R.ok(userAssetWrenchReceiveService.getReceiveList(param));
    }
}
